﻿using J.Status.Application.Command.BookingCommand;
using MediatR;
using StatusService;

namespace J.Status.Application.Handler.BookingHandler
{
    public class BookingRetainUpdateHandler:IRequestHandler<BookingRetainUpdateCommand,int>
    {
        private readonly IBookingService bookingService;
        public BookingRetainUpdateHandler(IBookingService bookingService)
        {
            this.bookingService = bookingService;
        }

        public async Task<int> Handle(BookingRetainUpdateCommand request, CancellationToken cancellationToken)
        {

            return await bookingService.TransactionRetain(request.Id, request.state,request.roomNumber,request.reserves);
        }
    }
}
